#include<bits/stdc++.h>
using namespace std;

int main() {
	int t;
	cin >> t;
	while(t -- ) {
		int a[5];
		bool flag = false;
		for(int i = 1; i <= 4; i ++ ) {
			cin >> a[i];
			if(i >= 2 && a[i] != a[i - 1]) {
				flag = true;
			}
		} 
		if(flag)
		cout << "YES\n";
		else
		cout << "NO\n";
	}
	return 0;
}

